package com.oocl.homework.format.comparator;

import java.util.Comparator;

import com.oocl.homework.format.moel.Customer;

public class CustomerIdComparator implements Comparator<Customer> {

	public int compare(Customer o1, Customer o2) {
		
		if (o1.getId()==null||o2.getId()==null) {
			if (o1.getId()==null||o2.getId()==null) {
				return 0;
			}
			if(o1.getId()==null){
				return -1;
			}
			if(o2.getId()==null){
				return 1;
			}
		}
		int t = o1.getId().compareTo(o2.getId());
		return t==0?-1:t;
	}

}
